package com.chutoutian.untils;

import java.util.Base64;

/**
 * @program: change
 * @Date: 2018/12/4 13:45
 * @Author: Mr.Zheng
 * @Description:
 */
public class Base64Util {
    /**
     * 加密
     * @param content
     */
    public static void encrypt(String content) {
        String msg = Base64.getEncoder().encodeToString(content.getBytes());
        System.out.println("加密：" + msg);
    }
    /**
     * 解密
     * @param content
     */
    public static void decrypt(String content) {
        byte[] byteArr = Base64.getDecoder().decode(content);
        String msg2 = new String(byteArr);
        System.out.println("解密:" + msg2);
    }
}